package com.aaa.controller.yy;



import com.aaa.pojo.ResultBean;
import com.aaa.pojo.yy.TesterSds;
import com.aaa.service.yy.TesterSdsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/testerSds")
public class TesterSdsController {
        @Autowired
        private TesterSdsService testerSdsService;

    ResultBean resultBean = new ResultBean();
    @RequestMapping("/TesterSdsFindAll")
    public ResultBean TesterSdsFindAll(String page, String limit){
        int count = testerSdsService.findCount();
        List<TesterSds> all = testerSdsService.findAll1(page,limit);
        resultBean.setCode(0);
        resultBean.setMsg("");
        resultBean.setCount(count);
        resultBean.setData(all);
        return resultBean;

    }
    @RequestMapping("/deleteId")
    @ResponseBody
    public ResultBean deleteId(String idList){
        System.out.println(idList);
        int i = testerSdsService.deleteId(idList);
        resultBean.setCode(0);
        resultBean.setMsg("");
        resultBean.setCount(1);
        resultBean.setData(idList);
        return resultBean;
    }
    @RequestMapping("/deleteList")
    public ResultBean deleteList(List<String> idList){
        System.out.println(idList);
        int testerSds = testerSdsService.deleteList(idList);
        resultBean.setCode(0);
        resultBean.setMsg("");
        resultBean.setCount(testerSds);
        resultBean.setData(idList);
        return resultBean;
    }


}
